Skip to content

Conversation

tysoncung
Copy link
Contributor

@tysoncung tysoncung commented Sep 13, 2025

Summary

This PR fixes a JavaScript lint error reported by the automated lint workflow.

Changes

  • Move Foo constructor function from inside the benchmark function to module scope
  • Add appropriate JSDoc documentation for the moved function
  • Maintain prototype assignment at module scope

Details

The lint error was:

/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js
  38:2  error  Function 'Foo' should be moved to module scope  stdlib/no-unnecessary-nested-functions

The function has been moved to module scope as required by the stdlib/no-unnecessary-nested-functions rule.

Related Issues

Resolves #8061

Checklist

  • Read, understood, and followed the contributing guidelines
  • Searched for related issues and pull requests
  • The pull request is associated with an issue
  • Tests pass locally
  • Documentation is updated as appropriate

Notes

This is my contribution to help maintain the high code quality standards of the stdlib project. The fix is straightforward - moving the function to module scope while preserving all functionality.

Move Foo constructor function to module scope to resolve the
stdlib/no-unnecessary-nested-functions lint error.

The function was previously defined inside the benchmark function
but has been moved to module scope with appropriate JSDoc comments.
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot
Copy link
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Gitter channel to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Sep 13, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/properties $\color{green}103/103$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}103/103$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this PR.

@tysoncung
Copy link
Contributor Author

Thank you for the warm welcome! 👋

I've updated the PR description to include the contributing guidelines acknowledgment checkbox. I've read and understood the contributing guidelines, including the developer's certificate of origin.

The coverage report shows 100% coverage maintained, which is great. Looking forward to your review when you have time!

Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @tysoncung, for filing this PR! Looks all good and I will hence merge it shortly.

Welcome to the project! 👋

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Sep 13, 2025
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 13, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Sep 13, 2025

PR Commit Message

chore: fix JavaScript lint errors

PR-URL: https://github.com/stdlib-js/stdlib/pull/8062
Closes: https://github.com/stdlib-js/stdlib/issues/8061

Reviewed-by: Philipp Burckhardt <[email protected]>

Please review the above commit message and make any necessary adjustments.

@Planeshifter Planeshifter merged commit e9406ad into stdlib-js:develop Sep 13, 2025
86 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. Ready To Merge A pull request which is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors
3 participants